package com.qst.crop.dao;

import com.qst.crop.entity.*;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Select;
import org.mockito.internal.matchers.Or;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author spengda
 * @date 2024/3/815:27
 */
@Component
public interface
OrderDao {

    int deleteByPrimaryKey(Integer orderId);




   /* List<Order> findAll(Integer pageNum);*/
    List<Order> findAll();

    @Select("select * from tb_sell_purchase where own_name = #{username}")
    List<SellPurchase> findByName(String username);


    Order selectById(int id);


    List<Order> search(String username,String type);

    List<Order> searchAll(String type);

    List<Order> searchMyGoodsByKeys(String title);

    int updateGoods(Order order);


    List<Order> findAllNeeds();


    List<Order> searchNeedsByKeys(String keys);


    List<Order> selectById(Integer id);


    int deleteByPrimaryKey(OrderDeleteParams params);

    int insert(Order record);

    int insertSelective(Order record);

    Order selectByPrimaryKey(Integer orderId);

    int updateByPrimaryKeySelective(Order record);

    int updateByPrimaryKey(Order order);

    Order selectBuyByUserName(String username);


    Order selectSellByUserName(String username);

    Order selectOrderByUsernameAndType(String username, String type);
    /* List<Order> findAll(Integer pageNum);*/
    List<Order> findAll(String username);
    List<Order> selectBuys(String ownName);

    Order selectBuysDetail(int orderId);


    List<Order> searchMyNeedsByKeys(String content, String username);
    int commitOrder(OrderAndShop orderandshop);

    List<Order> searchAllByKeys(String keys);


    int delOrderById(Integer id);

    List<Order> findAllGoods();

    List<Order> searchGoodsByKeys(String keys);

    int takeUpDownOrder(Integer id,Integer status);


   /**
   * 获取商品详情界面的商品轮播图
   * database：tb_order_picture
   * @param id
   * @return
   */
   List<String> getOrderCarousel(Integer id);


   /**
    * 针对商品发表评论
    * @param orderDiscuss
    * @return
    */
   int leaveComments(OrderDiscuss orderDiscuss);

 /**
  * 给别人评论的时候，给别人的评论数量++
  * @param newNum
  * @return
  */
 int commentsNumAdd(String username,Integer newNum);
}
